package com.youlv.yl.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.youlv.yl.bo.ShopCategoryBo;
import com.youlv.yl.entity.shopping.ShopCome;
import org.apache.ibatis.annotations.Select;


import java.util.List;


public interface ShoppingDao extends BaseMapper<ShopCome>{
    @Select("SELECT a.* ,b.catename FROM u_shopcome a LEFT JOIN u_shopcategory b ON a.categoryid=b.id;")
    List<ShopCategoryBo> getAllShops();

    @Select("SELECT a.* ,b.catename FROM u_shopcome a LEFT JOIN u_shopcategory b ON a.categoryid=b.id WHERE a.id=#{id}")
    ShopCategoryBo getOneShop(String id);

    @Select("SELECT a.* ,b.catename FROM u_shopcome a LEFT JOIN u_shopcategory b ON a.categoryid=b.id WHERE a.shopname like '%${shopname}%' ")
    List<ShopCategoryBo> searchShop(String shopname);
}
